package com.ftg.learn.chapter04.mapper;

import com.ftg.learn.chapter04.domain.DemoDomain;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DemoMapper {

    /**
     * 插入数据
     * @param demo 表里面的实休
     * @return int
     */
    @Insert("insert into demo(name,age,address) values(#{name},#{age},#{address})")
    int insertDemo(DemoDomain demo);

    /**
     * 查询数据
     * @return List<DemoDomain>
     */
    @Select("select id,name,age,address from demo")
    List<DemoDomain> selectDemo();


}
